import React, { Component } from "react";

import ReactDom from "react";

export default class State extends Component {
    state = {
        count: 0
    }

    addCount = ()=>{
        // this.state.count += 1

        this.setState({
            count: this.state.count +=1
        })
    }

    render() {
        return (
            <div>
                <h1>state组件 实现 state 数据处理</h1>
                <h2> {this.state.count} </h2>
                <button onClick={this.addCount}> count++ </button>
            </div>
        )
    }
}